<!doctype html>
<html>
	<head>
		<meta charset="utf-8">
		<title>飞机大战</title>
	</head>

	<body>
		<div id="stage" style="margin: 0 auto; width: 480px; height: 650px; text-align: center; vertical-align: middle" >
			<canvas id="canvas" style="border:2px solid red;" width="480" height="650">
				不支持画板对象
			</canvas>
		</div>
		<script>
			//创建Number构造方法,存储数字对象
			function Number(num1, num2) {
				this.num1 = num1;
				this.num2 = num2;
				this.plus = function() {
					var plus = this.num1 + "+" + this.num2 + "=";
					var num3 = this.num1 + this.num2;
					return plus + num3;
				};
				this.reduce = function() {
					var reduce = this.num1 + "-" + this.num2 + "=";
					var num3 = this.num1 - this.num2;
					return reduce + num3;
				};
				this.ride = function() {
					var ride = this.num1 + "*" + this.num2 + "=";
					var num3 = this.num1 * this.num2;
					return ride + num3;
				};
				this.except = function() {
					var except = this.num1 + "/" + this.num2 + "=";
					var num3 = this.num1 / this.num2;
					return except + num3;
				};
			};

			//创建数组num
			var num = [];
			num[0] = new Number(5, 3);
			num[1] = new Number(4, 8);
			num[2] = new Number(199, 48);
			//在警告框上显示加、减、乘、除的计算结果
			
			alert(num[2].plus());
			alert(num[2].reduce());
			alert(num[2].ride());
			alert(num[2].except());

		</script>
	</body>
</html>